#include <iostream>
using namespace std;

struct Node{
	string str;
	float  flo;
	Node*  next;
	Node(string s, float f, Node* n){ str = s; flo = f; next = n;}

};
void addToBegin( Node*& f, string s, float x){
	Node* p = new Node( s, x, NULL );
	p->next = f;
	f = p;
}
void addToEnd( Node*& f, string s, float x){
	if (f == NULL){
		f = new Node( s, x, NULL);
		return;
	}
	//loop to get to the end - does not work
	Node* temp = f;
	while (temp != NULL){
		temp = temp->next;
	}
	Node* p = new Node( s, x, NULL );
	temp->next = p;
}
void addSorted(Node* f, string s, float f){

}
bool searchf(Node* f,  float x){
	return true;
}
void deletef(Node* f, float x){

}
void deleteAll(Node* f){

}
void print(Node* f);
int main() {
	Node* first = NULL;
	addToBegin(first, "Hello", 1.9);
	addToEnd( first, "Goodbye", 3.1415 );
	print(first);
	return 0;
}
void print(Node* f){
	while (f != NULL){
		cout << "[ " << f->str << ", " << f->flo << " ]" << endl;
		f = f->next;
	}
	cout << "done!";
}
